<template>
  <div class="articleItem">
    <van-cell :title="row.title" :to="'/detail/' + row.art_id">
      <!-- 自定义右侧内容 -->
      <template >
        <van-image
        v-if="row.cover.type === 1"
        class="right-img"
        :src="row.cover.images[0]"
        />
      </template>
      <!-- 标题底部描述内容 -->
      <template #label>
        <div class="image-box" v-if="row.cover.type === 3">
          <van-image
            width="100"
            height="100"
            v-for="(item,index) in row.cover.images"
            :key="index"
            :src="item"
          />
        </div>
        <span>{{row.aut_name}}</span>
        <span class="comment-num">{{row.comm_count}}评论</span>
        <span>{{row.pubdate|relativeTime}}</span>
      </template>
    </van-cell>
  </div>
</template>

<script>
export default {
  name: 'ArticleItem',
  data () {
    return {

    }
  },
  props: {
    row: {
      type: Object,
      required: true
    }
  },
  created () {

  },

  methods: {

  }
}
</script>

<style scoped lang='less'>
.articleItem{
  .comment-num{
    padding: 0 15px;
  }
  // 三张图片样式
  .image-box{
    display: flex;
    justify-content: space-between;
  }

  .right-img{
    width: 232px;
    height: 146px;
  }
}
</style>
